<template>
  <a-modal
    :visible="visible"
    title="审核论文"
    :width="600"
    okText="提交审核"
    @cancel="() => { $emit('cancel') }"
    @ok="confirm"
  >
    <detail-list :col="1">
      <detail-list-item term="学号">{{info.xh}}</detail-list-item>
      <detail-list-item term="姓名">{{info.xm}}</detail-list-item>
      <detail-list-item term="指导教师所在院系">{{info.zdlsssyxmc}}</detail-list-item>
      <detail-list-item term="指导教师姓名">{{info.zdlsxm}}</detail-list-item>
      <detail-list-item term="授予学位的大学">{{info.syxwddx}}</detail-list-item>
      <detail-list-item term="论文题目">{{info.lwtm}}</detail-list-item>
      <detail-list-item term="专业领域">{{info.zyly}}</detail-list-item>
      <detail-list-item term="英文摘要">{{info.ywzy}}</detail-list-item>
      <detail-list-item term="中文摘要">{{info.zwzy}}</detail-list-item>
    </detail-list>
    <a-form :form="form">
      <a-form-item
        label="审核结果"
        :labelCol="{span: 5,offset: 1}"
        :wrapperCol="{span: 6, offset: 1}">
        <a-select v-decorator="['shzt',
          {
            rules: [{ required: true, message: '请选择导师审核结果!' }],
          }]" >
          <a-select-option v-if="pageType == 'bsbylw'" value="21">审核通过</a-select-option>
          <a-select-option v-if="pageType == 'bsbylw'" value="22">审核不通过</a-select-option>
          <a-select-option v-if="pageType == 'gjc'" value="23">国际处审核已通过</a-select-option>
          <a-select-option v-if="pageType == 'gjc'" value="24">国际处审核未通过</a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item
        label="审核意见"
        :labelCol="{span: 5,offset: 1}"
        :wrapperCol="{span: 12, offset: 1}">
        <a-textarea v-decorator="['shyj']" />
      </a-form-item>
    </a-form>
  </a-modal>

</template>

<script>
import { STable } from '~'
import { mapState } from 'vuex'
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item

export default {
  props: ['visible', 'id','pageType'],
  components: {DetailList, DetailListItem, STable},
  data () {
    return {
      form: this.$form.createForm(this),
      info:{}
    }
  },
  created () {
  },
  methods: {
    confirm () {
      this.form.validateFields((err, values) => {
        if (err) return
        if(this.pageType == 'bsbylw'){
          this.$api.overseas.paperCheck({...values, id: this.id}).then(res => {
            this.$message.success(res.msg)
            this.form.resetFields()
            this.$emit('cancel')
            this.$emit('refresh')
          })
        }else{
          this.$api.overseas.paperCheckGjc({...values, id: this.id}).then(res => {
            this.$message.success(res.msg)
            this.form.resetFields()
            this.$emit('cancel')
            this.$emit('refresh')
          })
        }
        
      })
    }
  }
}
</script>

<style>

</style>
